<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('详情')"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: jquery-smartwizard-css"/>
    <link rel="stylesheet" th:href="@{/web/talents/css/talents.css}"/>
    <style>

    </style>
</head>
<body>
<div class="main-content">
    <input name="filePath" type="hidden" th:value="${workOrder.filePath}" id="filePath"/>
    <input name="fileName" type="hidden" th:value="${workOrder.fileName}" id="fileName"/>

    <div class="card">
        <div class="card-header border-none">
            <h5 class="card-title mb-0">
                <div class="info_business">
                    <p class="info_business_tit" style="border-left: 3px solid red;text-indent: 10px;" th:text="工单告警信息"></p>
                </div>
            </h5>
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-sm-12">
                    <label class="details_p">工单名称：<span th:text="${workOrder.name}"></span></label>
                </div>
                <div class="col-sm-6 ">
                    <label class="details_p">工单编号：<span th:text="${workOrder.eventNumber}"></span></label>
                </div>
                <div class="col-sm-6 ">
                    <label class="details_p">设备类型：<span
                            th:text="${@dict.getLabel('gy_device_type', workOrder.deviceType)}"></span></label>
                </div>
                <div class="col-sm-6 ">
                    <label class="details_p">创建时间：<span   th:text="${#dates.format(workOrder.createTime, 'yyyy-MM-dd HH:mm:ss')}"></span></label>

                </div>
                <div class="col-sm-6 ">
                    <label class="details_p">计划完成时间：<span
                            th:text="${#dates.format(workOrder.planFinshTime, 'yyyy-MM-dd')}"></span></label>

                </div>
                <div class="col-sm-6 ">
                    <label class="details_p">工单状态：<span
                            th:text="${@dict.getLabel('work_order_status', workOrder.workStatus)}"></span></label>

                </div>
                <div class="col-sm-6 ">
                    <label class="details_p">工单类型：<span
                            th:text="${@dict.getLabel('work_order_type', workOrder.workType)}"></span></label>

                </div>
                <div class="col-sm-12">
                    <label class="details_p">工单描述：<span th:text="${workOrder.description}"></span></label>
                </div>
            </div>
        </div>
    </div>
    <div class="card">
        <div class="card-header border-none">
            <h5 class="card-title mb-0">
                <div class="info_business">
                    <p class="info_business_tit" style="border-left: 3px solid red;text-indent: 10px;"  th:text="申办信息"></p>
                </div>
            </h5>
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-sm-6 ">
                    <label class="details_p">实际开始时间： <span
                            th:text="${#dates.format(workOrder.startTime, 'yyyy-MM-dd')}"></span></label>
                </div>
                <div class="col-sm-6 ">
                    <label class="details_p">实际完成时间： <span
                            th:text="${#dates.format(workOrder.endTime, 'yyyy-MM-dd')}"></span></label>
                </div>
                <div class="col-sm-6 ">
                    <label class="details_p">处理人：<span th:text="${workOrder.processUser?.userName}"></span></label>

                </div>
                <div class="col-sm-6 ">
                    <label class="details_p">处理人手机号码：<span
                            th:text="${workOrder.processUser?.phonenumber}"></span></label>

                </div>
                <div class="col-sm-12">
                    <label class="details_p">处理内容说明：<span class="form-readonly" th:utext="${workOrder.processContent}"></span></label>

                </div>
                <div class="col-sm-12">
                    <label class="details_p" id="fj">处理附件下载：
                        <button type="button" id="fileDown" onclick="downloadFile()" class="btn btn-w-m btn-primary">下载附件
                        </button>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <div class="card">
        <div class="card-header border-none">
            <h5 class="card-title mb-0">
                <div class="info_business">
                    <p class="info_business_tit" style="border-left: 3px solid red;text-indent: 10px;" th:text="审核信息"></p>
                </div>
            </h5>
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-sm-12 ">
                    <label class="details_p">审核意见：<span th:text="${workOrder.memo}"></span></label>

                </div>
                <div class="col-sm-12 ">
                    <label class="details_p">审核时间：<span
                            th:text="${#dates.format(workOrder.auditTime, 'yyyy-MM-dd HH:mm:ss')}"></span></label>

                </div>
            </div>
        </div>
        <div class="btn-action-wrap">
            <button type="button" class="btn btn-sm btn-secondary" onclick="closeItem()"><i class="fa fa-times"></i> 关 闭
            </button>
        </div>
    </div>

</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: jquery-smartwizard-js"/>
<script th:inline="javascript">
    $(function () {
        if ($("#filePath").val() == "") {

            $("#fileDown").hide()
            $("#fj").hide();
        } else {

            $("#fileDown").show()
            $("#fj").show();
        }
    });


    function downloadFile() {
        var elelink = document.createElement("a");
        elelink.style.display = 'none';
        elelink.target = '_blank';
        elelink.href = $("#filePath").val();
        elelink.download =$("#fileName").val();
        document.body.appendChild(elelink);
        elelink.click();
        document.body.removeChild(elelink);
    }
</script>
</body>
</html>
